package com.lmj.controller;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.lmj.dao.IHeroinfoDao;
import com.lmj.model.Heroinfo;
import com.lmj.model.HeroinfoDTO;

@RestController
@RequestMapping("heroinfo")
public class HeroinfoController {

	@Resource
	private IHeroinfoDao heroinfodao;
	
	@RequestMapping("findAll.do")
	public Map findAll(HeroinfoDTO dto) {
		Map map = new HashMap();
		map.put("code", "0");
		map.put("msg", "");
		map.put("count", heroinfodao.getCount(dto));
		map.put("data", heroinfodao.findAll(dto));
		return map;
	}
	
	
	@RequestMapping("edit.do")
	public Integer edit(Heroinfo h) {
		return heroinfodao.edit(h);
	}

	
}
